﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Popup_Mat1.aspx.cs" Inherits="Popup_Popup_Mat" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../CustomCss.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/examples.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">       
       
       var CreateRow = function(){
            parent.SelectAddMat(document.getElementById("hdRowValue").value, "1");
            parent.Ext.getCmp('Window1').hide();
       }
       
       
    </script>
    <title>제목 없음</title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:Viewport ID="Viewport1" runat="server" StyleSpec="background-color: transparent;">
        <Items>
            <ext:BorderLayout ID="BorderLayout1" runat="server">
                <North>
                    <ext:Panel ID="Panel3" runat="server" Title="" StyleSpec="height:30px;">
                        <Content>
                            <table>
                                <tr>
                                    <td>
                                        <ext:TextField ID="tbxCustomer" runat="server" FieldLabel=" 업체명 "
                                         />
                                    </td>
                                    <td>
                                        <ext:TextField ID="tbxMat" runat="server" FieldLabel=" 자재명 " />
                                    </td>
                                    <td>
                                        <ext:Button ID="btnSearch" runat="server" Text="조회" Icon="Zoom">
                                            <DirectEvents>
                                                <Click OnEvent="PopListSearch">
                                                    <EventMask ShowMask="true" Msg="조회중입니다..." MinDelay="50" />
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </td>
                                    <td>
                                        <ext:Button ID="btnAdd" runat="server" Text="등록" Icon="Add">
                                            <Listeners>
                                                <Click Fn="CreateRow" />
                                            </Listeners>
                                        </ext:Button>
                                    </td>
                                </tr>
                            </table>
                        </Content>
                    </ext:Panel>
                </North>
                <West Collapsible="true" Split="true" MinWidth="90" MaxWidth="400" MarginsSummary="5 0 5 5"
                    CMarginsSummary="31 5 5 5">
                    <ext:Panel runat="server" Title="" ID="pnlWest" AutoScroll="true" StyleSpec="width:200px;">
                        <Items>
                            <ext:ListView ID="ListView1" runat="server" MultiSelect="true" ReserveScrollOffset="true"
                                 EmptyText="" Selectable="true">
                                <Store>
                                    <ext:Store ID="Store1" runat="server" OnRefreshData="SetListViewData" >
                                        <Reader>
                                            <ext:JsonReader IDProperty="name">
                                                <Fields>
                                                    <ext:RecordField Name="BIZ_REGNO" />
                                                    <ext:RecordField Name="REPR_NM" />
                                                    <ext:RecordField Name="COMP_NM" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                    </ext:Store>
                                </Store>
                                <Columns>
                                    <ext:ListViewColumn Header="업체명" Width="0.6" DataIndex="COMP_NM" Sortable="True" />
                                    <ext:ListViewColumn Header="사업자등록번호" Width="0.25" DataIndex="BIZ_REGNO" />
                                    <ext:ListViewColumn Header="대표자명" Width="0.15" DataIndex="REPR_NM" />
                                </Columns>
                                <DirectEvents>
                                    <SelectionChange OnEvent="ListView1_SelectionChange">
                                        <ExtraParams>
                                            <ext:Parameter Name="Values" Value="Ext.encode(#{ListView1}.getRowsValues({ selectedOnly : true }))" Mode="Raw" />
                                        </ExtraParams>
                                        <EventMask ShowMask="true" Msg="조회중입니다..." MinDelay="30" />
                                    </SelectionChange>
                                </DirectEvents>
                            </ext:ListView>
                        </Items>
                    </ext:Panel>
                </West>
                <Center MarginsSummary="5 5 5 0">
                    <ext:FormPanel ID="formContent" runat="server" HideBorders="true">
                        <Items>
                            <ext:GridPanel ID="GridPanel1" runat="server" AutoScroll="true" Cls="my-grid" Height="350">
                                <Store>
                                    <ext:Store ID="Store2" runat="server">
                                        <Reader>
                                            <ext:JsonReader>
                                                <Fields>
                                                    <ext:RecordField Name="BIZ_REGNO" />
                                                    <ext:RecordField Name="COMP_NM" />
                                                    <ext:RecordField Name="ITEM_GUBUN" />
                                                    <ext:RecordField Name="CD" />
                                                    <ext:RecordField Name="NAME" />
                                                    <ext:RecordField Name="SPEC" />
                                                    <ext:RecordField Name="UNIT" />
                                                </Fields>
                                            </ext:JsonReader>
                                        </Reader>
                                        <Listeners>
                                            <LoadException Handler="var e = e || {메시지: response.responseText}; alert('로드하지 못했습니다.: ' + e.message);" />
                                        </Listeners>
                                    </ext:Store>
                                </Store>
                                <View>
                                    <ext:GridView ID="GridView1" runat="server"/>
                                </View>
                                <ColumnModel ID="ColumnModel1" runat="server">
                                    <Columns>
                                        <ext:Column ColumnID="BIZ_REGNO" Header="사업자번호" Width="60" DataIndex="BIZ_REGNO" Hidden="true" />
                                        <ext:Column ColumnID="COMP_NM" Header="업체명" Width="120" DataIndex="COMP_NM" />
                                        <ext:Column ColumnID="ITEM_GUBUN" Header="구분" Width="70" DataIndex="ITEM_GUBUN" Align="Center" />
                                        <ext:Column ColumnID="CD" Header="자재코드" Width="120" DataIndex="CD" />
                                        <ext:Column ColumnID="NAME" Header="자재명" Width="160" DataIndex="NAME" />
                                        <ext:Column ColumnID="SPEC" Header="규격" Width="100" DataIndex="SPEC" />
                                        <ext:Column ColumnID="UNIT" Header="단위" Width="70" DataIndex="UNIT" />
                                    </Columns>
                                </ColumnModel>
                                <SelectionModel>
                                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                                        <DirectEvents>
                                            <RowSelect OnEvent="CreateParameter">
                                                <ExtraParams>
                                                    <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly:true}))" Mode="Raw" />
                                                </ExtraParams>
                                            </RowSelect>
                                        </DirectEvents>
                                    </ext:RowSelectionModel>
                                </SelectionModel>
                            </ext:GridPanel>
                        </Items>
                    </ext:FormPanel>
                </Center>
            </ext:BorderLayout>
        </Items>
    </ext:Viewport>
    <ext:Hidden ID="hdRowValue" runat="server" />
    <ext:Hidden ID="hdREGNO" runat="server" />
    </form>
</body>
</html>
